DoesNotContain(TCollection) Method (ConditionValidator(TCollection), Object, String)

CuttingEdge.Conditions

Checks whether the given value does not contain the specified element. An exception is thrown otherwise. When the value is a null reference it is considered empty and therefore won't contain element.

Namespace:  CuttingEdge.Conditions
Assembly:  CuttingEdge.Conditions (in CuttingEdge.Conditions.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function DoesNotContain(Of TCollection As IEnumerable) ( _
	validator As ConditionValidator(Of TCollection), _
	element As Object, _
	conditionDescription As String _
) As ConditionValidator(Of TCollection)
C#
public static ConditionValidator<TCollection> DoesNotContain<TCollection>(
	ConditionValidator<TCollection> validator,
	Object element,
	string conditionDescription
)
where TCollection : IEnumerable
Visual C++
public:
generic<typename TCollection>
where TCollection : IEnumerable
static ConditionValidator<TCollection>^ DoesNotContain(
	ConditionValidator<TCollection>^ validator, 
	Object^ element, 
	String^ conditionDescription
)
JavaScript
JavaScript does not support generic types or methods.

Parameters

validator
Type: CuttingEdge.Conditions..::.ConditionValidator<(Of <(TCollection>)>)
The ConditionValidator<(Of <(T>)>) that holds the value that has to be checked.
element
Type: System..::.Object
The element that should contain the given value.
conditionDescription
Type: System..::.String
The description of the condition that should hold. The string may hold the placeholder '{0}' for the ArgumentName.

Type Parameters

TCollection
The type of the value to check.

Return Value

The specified validator instance.

Exceptions

ExceptionCondition
System..::.ArgumentExceptionThrown when the Value of the specified validator does contain element, while the specified validator is created using the Requires extension method.
CuttingEdge.Conditions..::.PostconditionExceptionThrown when the Value of the specified validator does contain element, while the specified validator is created using the Ensures extension method.

See Also